home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / MACVOGL- / FHTEXT.C < prev    next >
Text File  |  1992-07-19  |  4KB  |  452 lines

  1.  
  2. #include <stdio.h>
  3.  
  4. /*
  5.  * hsetpath_
  6.  */
  7. void
  8. hsetpath_(fpath, len1, len2)
  9.     char    *fpath;
  10.     int    *len1;
  11.     int    len2;
  12. {
  13.     char    buf[BUFSIZ];
  14.  
  15.     strncpy(buf, fpath, len2);
  16.     buf[*len1] = 0;
  17.  
  18.     hsetpath(buf);
  19. }
  20.  
  21. /*
  22.  * hsetpa_
  23.  */
  24. void
  25. hsetpa_(fpath, len1, len2)
  26.     char    *fpath;
  27.     int    *len1;
  28.     int    len2;
  29. {
  30.     char    buf[BUFSIZ];
  31.  
  32.     strncpy(buf, fpath, len2);
  33.     buf[*len1] = 0;
  34.  
  35.     hsetpath(buf);
  36. }
  37.  
  38. /*
  39.  * hfont_
  40.  */
  41. void
  42. hfont_(fontfile, len1, len2)
  43.     char    *fontfile;
  44.     int    *len1;
  45.     int    len2;
  46. {
  47.     char    buf[BUFSIZ];
  48.  
  49.     strncpy(buf, fontfile, len2);
  50.     buf[*len1] = 0;
  51.  
  52.     hfont(buf);
  53. }
  54.  
  55. /*
  56.  * htextsize_
  57.  */
  58. void
  59. htextsize_(width, height)
  60.     double    *width, *height;
  61. {
  62.     htextsize(*width, *height);
  63. }
  64.  
  65. /*
  66.  * htexts_
  67.  */
  68. void
  69. htexts_(width, height)
  70.     double    *width, *height;
  71. {
  72.     htextsize(*width, *height);
  73. }
  74.  
  75. /*
  76.  * hboxtext_
  77.  */
  78. hboxtext_(x, y, l, h, s, length, len)
  79.     double    *x, *y, *l, *h;
  80.     char    *s;
  81.     int    *length;
  82.     int    len;
  83. {
  84.     char        buf[BUFSIZ];
  85.     register char   *p;
  86.  
  87.     strncpy(buf, s, len);
  88.     buf[*length] = 0;
  89.  
  90.     hboxtext(*x, *y, *l, *h, buf);
  91. }
  92.  
  93. /*
  94.  * hboxte_    (same as hboxtext_)
  95.  */
  96. hboxte_(x, y, l, h, s, length, len)
  97.     double    *x, *y, *l, *h;
  98.     char    *s;
  99.     int    *length;
  100.     int    len;
  101. {
  102.     char        buf[BUFSIZ];
  103.     register char   *p;
  104.  
  105.     strncpy(buf, s, len);
  106.     buf[*length] = 0;
  107.  
  108.     hboxtext(*x, *y, *l, *h, buf);
  109. }
  110.  
  111. /*
  112.  * hboxfit_
  113.  */
  114. hboxfit_(l, h, nchars)
  115.     double    *l, *h;
  116.     int    *nchars;
  117. {
  118.     hboxfit(*l, *h, *nchars);
  119. }
  120.  
  121. /*
  122.  * hboxfi_
  123.  */
  124. hboxfi_(l, h, nchars)
  125.     double    *l, *h;
  126.     int    *nchars;
  127. {
  128.     hboxfit(*l, *h, *nchars);
  129. }
  130.  
  131. /*
  132.  * htextang_
  133.  */
  134. void
  135. htextang_(ang)
  136.     double    *ang;
  137. {
  138.     htextang(*ang);
  139. }
  140.  
  141. /*
  142.  * htexta_
  143.  */
  144. void
  145. htexta_(ang)
  146.     double    *ang;
  147. {
  148.     htextang(*ang);
  149. }
  150.  
  151. /*
  152.  * hdrawchar_
  153.  */
  154. hdrawchar_(s)
  155.     char    *s;
  156. {
  157.     hdrawchar(*s);
  158. }
  159.  
  160. /*
  161.  * hdrawc_
  162.  */
  163. hdrawc_(s)
  164.     char    *s;
  165. {
  166.     hdrawchar(*s);
  167. }
  168.  
  169. /*
  170.  * hcharstr_
  171.  */
  172. hcharstr_(s, length, len)
  173.     char    *s;
  174.     int    *length;
  175.     int    len;
  176. {
  177.         char            buf[BUFSIZ];
  178.     register char   *p;
  179.  
  180.     strncpy(buf, s, len);
  181.     buf[*length] = 0;
  182.     hcharstr(buf);
  183. }
  184.  
  185. /*
  186.  * hchars_
  187.  */
  188. hchars_(s, length, len)
  189.     char    *s;
  190.     int    *length;
  191.     int    len;
  192. {
  193.         char            buf[BUFSIZ];
  194.     register char   *p;
  195.  
  196.     strncpy(buf, s, len);
  197.     buf[*length] = 0;
  198.     hcharstr(buf);
  199. }
  200.  
  201. /*
  202.  * hgetfontheight_
  203.  */
  204. double
  205. hgetfontheight_()
  206. {
  207.     return(hgetfontheight());
  208. }
  209.  
  210. /*
  211.  * hgetfh_
  212.  */
  213. double
  214. hgetfh_()
  215. {
  216.     return(hgetfontheight());
  217. }
  218.  
  219. /*
  220.  * hgetfontwidth_
  221.  */
  222. double
  223. hgetfontwidth_()
  224. {
  225.     return(hgetfontwidth());
  226. }
  227.  
  228. /*
  229.  * hgetfw_
  230.  */
  231. double
  232. hgetfw_()
  233. {
  234.     return(hgetfontwidth());
  235. }
  236.  
  237. /*
  238.  * hgetdecender_
  239.  */
  240. double
  241. hgetdecender_()
  242. {
  243.     return(hgetdecender());
  244. }
  245.  
  246. /*
  247.  * hgetde_
  248.  */
  249. double
  250. hgetde_()
  251. {
  252.     return(hgetdecender());
  253. }
  254.  
  255. /*
  256.  * hgetascender_
  257.  */
  258. double
  259. hgetascender_()
  260. {
  261.     return(hgetascender());
  262. }
  263.  
  264. /*
  265.  * hgetas_
  266.  */
  267. double
  268. hgetas_()
  269. {
  270.     return(hgetascender());
  271. }
  272.  
  273. /*
  274.  * hgetfontsize_
  275.  */
  276. void
  277. hgetfontsize_(cw, ch)
  278.     double     *cw, *ch;
  279. {
  280.     hgetfontsize(cw, ch);
  281. }
  282.  
  283. /*
  284.  * hgetfs_
  285.  */
  286. void
  287. hgetfs_(cw, ch)
  288.     double     *cw, *ch;
  289. {
  290.     hgetfontsize(cw, ch);
  291. }
  292.  
  293. /*
  294.  * hgetcharsize_
  295.  */
  296. void
  297. hgetcharsize_(c, cw, ch)
  298.     char    *c;
  299.     double     *cw, *ch;
  300. {
  301.     hgetcharsize(*c, cw, ch);
  302. }
  303.  
  304. /*
  305.  * hgetch_
  306.  */
  307. void
  308. hgetch_(c, cw, ch)
  309.     char    *c;
  310.     double     *cw, *ch;
  311. {
  312.     hgetcharsize(*c, cw, ch);
  313. }
  314.  
  315. /*
  316.  * hfixedwidth
  317.  */
  318. void
  319. hfixedwidth_(i)
  320.     int    *i;
  321. {
  322.     hfixedwidth(*i);
  323. }
  324.  
  325. /*
  326.  * hfixed_
  327.  */
  328. void
  329. hfixed_(i)
  330.     int    *i;
  331. {
  332.     hfixedwidth(*i);
  333. }
  334.  
  335. /*
  336.  * hcentertext
  337.  */
  338. void
  339. hcentertext_(i)
  340.     int    *i;
  341. {
  342.     hcentertext(*i);
  343. }
  344.  
  345. /*
  346.  * hcente_
  347.  */
  348. void
  349. hcente_(i)
  350.     int    *i;
  351. {
  352.     hcentertext(*i);
  353. }
  354.  
  355. /*
  356.  * hrightjustify_
  357.  */
  358. void
  359. hrightjustify_(i)
  360.     int    *i;
  361. {
  362.     hrightjustify(*i);
  363. }
  364.  
  365. /*
  366.  * hright_
  367.  */
  368. void
  369. hright_(i)
  370.     int    *i;
  371. {
  372.     hrightjustify(*i);
  373. }
  374.  
  375. /*
  376.  * hleftjustify_
  377.  */
  378. void
  379. hleftjustify_(i)
  380.     int    *i;
  381. {
  382.     hleftjustify(*i);
  383. }
  384.  
  385. /*
  386.  * hleftj_
  387.  */
  388. void
  389. hleftj_(i)
  390.     int    *i;
  391. {
  392.     hleftjustify(*i);
  393. }
  394.  
  395. /*
  396.  * hnumchars_
  397.  */
  398. int
  399. hnumchars_()
  400. {
  401.     return(hnumchars());
  402. }
  403.  
  404. /*
  405.  * hnumch_
  406.  */
  407. int
  408. hnumch_()
  409. {
  410.     return(hnumchars());
  411. }
  412.  
  413. /*
  414.  * hstrlength_
  415.  */
  416. double
  417. hstrlength_(str, len0, len1)
  418.     char    *str;
  419.     int    *len0;
  420.     int    len1;
  421. {
  422.         char            buf[BUFSIZ];
  423.     register char   *p;
  424.  
  425.     strncpy(buf, str, len1);
  426.     buf[*len0] = 0;
  427.  
  428.     return(hstrlength(buf));
  429. }
  430.  
  431. /*
  432.  * hstrle_
  433.  */
  434. double
  435. hstrle_(str, len)
  436.     char    *str;
  437.     int    len;
  438. {
  439.         char            buf[BUFSIZ];
  440.     register char   *p;
  441.  
  442.     strncpy(buf, str, len);
  443.     buf[len] = 0;
  444.  
  445.     for (p = &buf[len - 1]; *p == ' '; p--)
  446.         ;
  447.  
  448.     *++p = 0;
  449.  
  450.     return(hstrlength(buf));
  451. }
  452.